<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>{{$smarty.session.user.nickname}}的用户中心_{{$smarty.const.SITENAME}}</title>
<link href="/static/css/base.css" rel="stylesheet" type="text/css">
<link href="/static/css/grid.css" rel="stylesheet" type="text/css">
<link href="/static/styles/global.css" rel="stylesheet" type="text/css" />
<link href="/static/css/ab.css" rel="stylesheet" type="text/css" />
<script language="javascript" src="/static/js/jquery.js" type=text/javascript></script>
<script language="javascript" src="/static/js/validator.js"></script>
<script language="javascript" src="/static/js/main.js"></script>
<script language="javascript">
var blog_content = '';
var blog_id = '{{$det.id|default:0}}';
window.onload = function(){
	validator('logs');
	//每隔1分钟保存一次
	blog_content = FCKeditorAPI.GetInstance('content').GetXHTML(true)
	setInterval(auto_save,60000);
};
function addCategory()
{
	var name = jQuery.trim($('#name').val());
	if(name=='')
	{
		alert('分类名称不能为空！');
	    return false;
	}
	$.post('/myblog/category/',{'name':name,'ajax':1},function(cid){
		  if(cid=='exists') 
		  {
			  alert('已存在！');
			  return false;
		  }
		  var option = document.createElement('option');
		  option.value = cid;
		  option.innerHTML = name;
		  option.checked = 'checked';
	      $('#c_id')[0].appendChild(option);
		  $('#c_id').val(cid);
		  $('#name').val('');
		  $('#new_cate').hide();
	});
}
</script>
</head>

<body>
{{include file='header.html}} 
<div class="ilayout">
<div class="imenubar">
{{include file='person_left.html'}}
</div>
<div class="icontent" id="pright">
{{include file=block/myblog_head.html}}
<!--邮件-->
<!--邮件-->
<!--编辑个人资料-->
<div class="memberlogs">
<form method="post" id="logs" name='logs'>
<div class="title">
标题：<input name="title" type="text" id="title" value="{{$det.title}}" size="70" empty="标题不能为空" />
<input name="id" type="hidden" id="id" value="{{$det.id}}" />
</div>
<div class="title">
分类：{{$form}}&nbsp;&nbsp;&nbsp;&nbsp;<a href="javascript:void(0)" onclick="$('#new_cate').show();">添加分类</a>
<span id='new_cate' style="display:none">
<label>
<input name="name" type="text" id="name" />
</label>
<label>
<input type="button" value="提交" onclick="addCategory()" />
</label>
<label>
<input type="button" value="取消" onclick="$('#new_cate').hide();" />
</label>
</span>
</div>
<div class="memeberLogsDetail">{{$editor}}</div>
<div class="clear"></div>
<div class="mailfiled" style="margin-top:5px; margin-bottom:5px;">
<button type="submit" class="btn1"><img src="/static/images/accept.png" width="16" height="16" /> 确认并发布日志</button>&nbsp;
<button name='act' type="submit" class="btn1" value="draft"><img src="/static/images/save.gif" width="16" height="16" /> 保存为草稿</button>
<span id='save_notice' style="color:#F00"></span>
</div>
</form>
</div>
<!--编辑个人资料-->
</div>
</div>
{{include file='footer.html}}
</body>
</html>